import Vue from 'vue'
import VueRouter from 'vue-router'
//import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/login'
  },
  {
    //登录路由没写重定向
    path:'/login',
    name:'Login',
    component:()=>import(/*webpackChunkName:"login" */'../views/Login/login.vue')
  },
  {
    path:'/homepage',
    name:"HomePage",
    component:()=>import('../views/HomePage/HomePage.vue'),
    children:[
      {
        path:'goods',
        component:()=>import('../views/HomePage/children/ContentChild/goods.vue'),

      },
      {
        path:'category',
        component:()=>import('../views/HomePage/children/ContentChild/category.vue'),

      },
      {
        path:'brand',
        component:()=>import('../views/HomePage/children/ContentChild/brand.vue'),

      },
      {
        path:'attribute',
        component:()=>import('../views/HomePage/children/ContentChild/attribute.vue'),

      }
    ]
  }
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   // path: '/about',
  //   // name: 'About',
  //   // // route level code-splitting
  //   // // this generates a separate chunk (about.[hash].js) for this route
  //   // // which is lazy-loaded when the route is visited.
  //   // component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
